---
title: Anthropic
description: Common questions about Anthropic provider
---

## How do I use the Anthropic cache?

[Anthropic cache](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching) allows you to cache parts of a prompt. As explained in their documentation, you need to opt-in within the prompt to start caching parts of it.

To do this, add `cacheControl: true` to the front matter of your prompt.

```markdown {4}
---
provider: name-of-your-antropic-provider-in-latitude
model: claude-3-5-sonnet-20241022
cacheControl: true
---
```

Once this is set up, you can start caching specific parts of the prompt:

```markdown {4}
<system>This part of the text is not cached</system>
<system>
  Read this large book and answer users' questions.
  <text cache_control={{ { type: 'ephemeral' } }}>
    ...BIG_BOOK_CONTENT...
  </text>
</system>
```

If you want an entire message to be cached, add the cache directive to the `user`, `assistant`, or `system` tags:

```markdown {1}
<user cache_control={{ { type: 'ephemeral' } }}>
  This text will be cached.
  <text>
    This text will also be cached.
  </text>
  And this text as well.
</user>
```

## How do I set the Anthropic thinking budget?

The latest Anthropic models have a configurable [thinking budget](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking) that allows you to control the amount of time the model spends reasoning to generate a response.

```markdown {4-6}
---
provider: name-of-your-anthropic-provider-in-latitude
model: claude-sonnet-4
thinking:
  type: enabled
  budgetTokens: 1024
---
```
